<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="./css/basic.css" />
    <title>20-定位position</title>
    <style>
      .container {
        width: 200px;
        height: 300px;
        background-color: pink;
        margin: 20px 50px;
        position: relative;
      }
      .item1 ,.item2, .item3, .item4, .item5, .item6, .item7, .item8, .item9{
        width: 50px;
        height: 50px;
        border-radius: 25px;
        position: absolute;
        background-color: palegoldenrod;
      }
     .item2{
        background-color: palegreen;
        position: absolute;
        right: 0;
     }
     .item3{
        background-color: paleturquoise;
        position: absolute;
        bottom: 0;
     }
     .item4{
        background-color: palevioletred;
        position: absolute;
        bottom: 0;
        right: 0;
     }
     .item5{
        background-color: papayawhip;
        position: absolute;
        left: 50%;
        transform: translate(-25px,0);
     }
     .item6{
        background-color: peachpuff;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-25px,-25px);
     }
     .item7{
        background-color: peru;
        position: absolute;
        top: 50%;
        transform: translate(0,-25px);
     }
     .item8{
        background-color: plum;
        position: absolute;
        top: 50%;
        right: 0;
        transform: translate(0,-25px);
     }
     .item9{
        background-color: purple;
        position: absolute;
        right:50%;
        bottom: 0;
        transform: translate(25px,0);
     }
     

    </style>
  </head>
  <body>
    <div class="container">
        <div class="item1"></div>
        <div class="item2"></div>
        <div class="item3"></div>
        <div class="item4"></div>
        <div class="item5"></div>
        <div class="item6"></div>
        <div class="item7"></div>
        <div class="item8"></div>
        <div class="item9"></div>
    </div>
  </body>
</html>
